package cn.it.shop.service.impl;

import java.util.List;
import java.util.Set;

import org.hibernate.classic.Session;
import org.springframework.stereotype.Service;

import cn.it.shop.pojo.Forder;
import cn.it.shop.pojo.Sorder;
import cn.it.shop.service.ForderService;

@Service("forderService")
public class ForderServiceImpl extends BaseServiceImpl<Forder> implements
		ForderService {

	@Override
	public double cluTotal(Forder forder) {
		double total = 0.0;
		Set<Sorder> sorderSet = forder.getSorderSet();
		for (Sorder temp : sorderSet) {
			total += temp.getNumber() * temp.getPrice();
		}
		return total;
	}

	@Override
	public void update(int id, int sid) {
		forderDao.update(id, sid);
	}
	
	

}
